import query from '@feidao-factory/atom-nodejs/db/query';

import { systemid } from '../../atom/config';
interface Message {
	filter: {
		[key: string]: string
	};
	page_no: number;
}


interface IRes {
	_id: string;
	category_no: string;
	category_name: string;
	description: string;
}

export default async function atom(msg: Message, action_id: string, session_id: string) {
	const { exec, prepare } = query(action_id, session_id, systemid);
	prepare('commodity', ['commodity_name'], msg.filter, 5, 1, [], []);
	const [data] = await exec<IRes>();

	return data;
}
